package com.zhengxin.one.common;

import lombok.Data;
import java.io.Serializable;

@Data
public class ResultPage implements Serializable{
    private int code;   //200正常 400异常
    private String msg;
    private Object data;
    private Object pageList;


    public static ResultPage successp(Object data,Object pageList){
        return successp(200,"操作成功",data,pageList);
    }

    public static ResultPage successp(int code, String msg, Object data,Object pageList){
        ResultPage r = new ResultPage();
        r.setCode(code);
        r.setMsg(msg);
        r.setData(data);
        r.setPageList(pageList);
        return r;
    }
    public static ResultPage fail(String msg){
        return fail(400,msg,"","");
    }

    public static ResultPage fail(int code, String msg, Object data,Object pageList){
        ResultPage r = new ResultPage();
        r.setCode(code);
        r.setMsg(msg);
        r.setData(data);
        r.setPageList(pageList);
        return r;
    }
}
